import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

/* Layout */
import Layout from '../views/layout/Layout'


export const constantRouterMap = [{
        path: '/login',
        component: () =>
            import ('@/views/login/index'),
        hidden: true
    },
    {
        path: '/404',
        component: () =>
            import ('@/views/404'),
        hidden: true
    },

    {
        path: '/',
        component: Layout,
        redirect: '/shop',
        name: 'shop',
        hidden: true,
        children: [
			{
				path: 'shop',
				name: 'shop',
				component: () =>
					import ('@/views/store/store')
			},
			{
				path: 'category',
				name: 'category',
				component: () =>
					import ('@/views/property/property')
			},
			{
                path: 'product',
                name: 'product',
                component: () =>
                    import ('@/views/goods/goods')
            }, 
			{
				path: 'order',
				name: 'order',
				component: () =>
					import ('@/views/order/order')
			},
			{
				path: 'member',
				name: 'member',
				component: () =>
					import ('@/views/members/members')
			},
			{
				path: 'trade',
				name: 'trade',
				component: () =>
					import ('@/views/financial/financial')
			},
			{
				path: 'permission',
				name: 'permission',
				component: () =>
					import ('@/views/permission/permission'),
				meta: {
					title: '权限',
					icon: 'icon-shuju'
				}
			},
            {
                path: 'loginOut',
                name: 'LoginOut',
                component: () =>
                    import ('@/views/loginOut/loginOut'),
                meta: {
                    title: '退出',
                    icon: 'icon-tuichu'
                }
            },
            
			
			
        ]
    },
    {
        path: '*',
        redirect: '/404',
        hidden: true
    }
]

export default new Router({
    scrollBehavior: () => ({
        y: 0
    }),
    routes: constantRouterMap
})
